package com.weisiqian.study.springcloud.serviceribbon.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

@Service
public class HelloService {

    @Autowired
    private RestTemplate restTemplate;

    /**
     * 调用服务提供者：EurekaServer中的接口
     * @param name 人名
     * @return 问好语句
     */
    public String helloService(String name){
        return restTemplate.getForObject("http://SERVER-HI/hello/sayHi?name=" + name, String.class);
    }

}


